<template>
    <div id="ApprovalProgress">
        <div v-if="ListData.length>0">
            <van-steps direction="vertical" :active="ListData.length" active-color="#7DBF51">
                <van-step v-for="(item,index) in ListData" :key="index">
                    <p>
                        {{ item.processNodeStr }}
                        <van-button size="mini" style="float: right;">已处理</van-button>
                    </p>
                    <div class="divConent">
                        <p>审核意见：{{ item.action }}</p>
                        <p>进入时间：{{ item.sendTime }}</p>
                        <p>结束时间：{{ item.endTime }}</p>
                        <p>操作人：{{ item.userName }}</p>
                    </div>
                </van-step>
            </van-steps>
        </div>
        <div v-else>
          <div style="height: 100%; text-align: center; padding-top: 24vh">
            <div style="margin-bottom: 10px">
              <img src="https://nfzjszlb.jst.zj.gov.cn/serverfile/zheliban/icon/DSF/50.png" />
            </div>
            <div>暂无数据</div>
          </div>
        </div>
    </div>
</template>
<script>
import {processList} from '@/utils/api'
export default {
    name: 'ApprovalProgress',
    data(){
        return{
            ListData: []
        }
    },
    methods:{
        getListData: async function(){
            this.ListData = []
            let params = {
                "objectNo": JSON.parse(this.$route.query.data).objectNo
                // "objectNo":"2f6e65db47c546b7a687654b0dc36e05"
            }
            const res = await processList(params)
            if(res.data.data.length>0){
                this.ListData = res.data.data
                this.ListData.forEach(ele =>{
                    if(ele.action == 1){
                        ele.action = '发送'
                    }else{
                        ele.action = '退回'
                    }
                })
            }
        }
    },
    mounted() {
        this.getListData();
        if (ZWJSBridge) {
            ZWJSBridge.setTitle({
                title: "审批进度",
            })
            .then((re2s) => {
            })
            .catch((err) => {
            });
        }
    },
}
</script>
<style lang="scss" scoped>
#ApprovalProgress{
    height: 100vh;
    padding: 10px;
    overflow-y: auto;
    .divConent{
        box-shadow: 1px 1px 4px 4px #e9e7e7;
        padding: 15px;
        margin-top: 10px;
        p{
            line-height: 24px;
        }
    }
}
</style>
<style lang="scss">
#ApprovalProgress{
    .van-button--default {
        color: #fff;
        background-color: #7DBF51;
        border: none;
    }
    .van-step__circle {
        width: 8px;
        height: 8px;
    }
}

</style>